<template>
  <div class="pdf-container">
    <iframe :src="`/static/pdfjs-2.4.456-dist/web/viewer.html?file=${encodeURIComponent(src)}`"></iframe>
  </div>
</template>

<script>
export default {
  data() {
    return {
      src: ""
    };
  },
  mounted() {
    // 这里是请求分片的接口，看情况修改
    this.src = `http://localhost:8181/v1/pdf/load`;
  }
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
</style>

<style scoped>
.pdf-container {
  width: 100vw;
  height: 100vh;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}
</style>
